package other.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

/**
 * @author hubb
 * @Date 2019/3/28 23:47
 */
public class AnnotationIntro {
    public static void main(String[] args) throws SecurityException, ClassNotFoundException {
        Method[] methods = Class.forName("other.AnnotationTest").getDeclaredMethods();


        Annotation[] annotations;


        for (Method method : methods) {

            annotations = method.getAnnotations();

            for (Annotation annotation : annotations) {

                System.out.println(method.getName() + " : "

                        + annotation.annotationType().getName());

            }
        }
    }
}
